﻿using System;
using System.Collections.Generic;
using System.Windows;
using System.Linq;
using Baosight.Platform.Core.UI.Controls;
using Baosight.Platform.Core;
using Baosight.ZNH.ZMCommon;
using Baosight.ZNH.ZMCommon.ChildWindows;
using Telerik.Windows.Controls;
using Baosight.ZNH.ZMCL.UI.PopWindows;
using Baosight.ZNH.ZMCL.UI.Blocks;
using System.Collections.ObjectModel;
using System.Windows.Browser;
using System.Text;

namespace Baosight.ZNH.ZMCL.UI
{
    public partial class ZMCL70 : EFViewCmes
    {
        private RiskBlock _block = new RiskBlock();

        public ZMCL70()
        {
            InitializeComponent();
            base.BeforeAction += OnBeforeAction;
        }

        /// <summary>
        /// 列表中修改、删除前设置属性、参数
        /// 传递到后台代码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnBeforeAction(object sender, EventArgs e)
        {
            EFViewCmesProperty _view = new EFViewCmesProperty();
            _view.EFGridCheckedRows = this.Grid.GetCheckedEIRows();
            base.ViewProperty = _view;
        }

        public override void Initialize(Baosight.Platform.Core.EIInfo initData)
        {
            initData.AddBlock(_block.GetIsPenaltyBlock(true));
            initData.AddBlock(_block.GetHandlingStatusBlock(true));
            this.fdEndDate.Value = DateTime.Now.ToString("yyyy-MM-dd");
            base.Initialize(initData);
        }

        /// <summary>
        /// 页签切换
        /// 刷新第二个页签数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EFTab_SelectionChanged(object sender, RoutedEventArgs e)
        {
            EFTab _tab = sender as EFTab;
            if (null != _tab)
            {
                EFTabItem _item = _tab.SelectedItem as EFTabItem;

                if (null != _item && this.handledRisk.IsSelected)
                {
                    this.handledRisk.LoadView<EFTabItem>("ZMCL72");
                }
            }
        }

        /// <summary>
        /// 主表选中记录发生改变
        /// 对于复查 不通过的隐患，显示以往复查记录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Grid_SelectionChanged(object sender, SelectionChangeEventArgs e)
        {
            if (null != this.Grid.SelectedItem)
            {
                EIRow _row = (this.Grid.SelectedItem as UIBaseEntity).GetEIRow();
                string fdIsRepeat = _row["fdIsRepeat"] == null ? "" : _row["fdIsRepeat"].ToString();
                string fdStatus = _row["fdStatus"] == null ? "" : _row["fdStatus"].ToString();

                //是否重复隐患
                if (!"否".Equals(fdIsRepeat) || !"未处理".Equals(fdStatus))
                {
                    Dictionary<string, string> args = new Dictionary<string, string>();
                    args.Add("fdRiskRecordId", _row["fdKeyId"].ToString());
                    this.riskDetails.LoadView<EFCustomViewContainerPanel>("ZMCL71", args);//加载从表页面

                    Dictionary<string, string> args1 = new Dictionary<string, string>();
                    args1.Add("fdPenaltyIds", _row["fdPenaltyIds"] == null ? "" : _row["fdPenaltyIds"].ToString());
                    this.riskPenalty.LoadView<EFCustomViewContainerPanel>("ZMCL75", args1);//加载从表页面
                }
                else
                {
                    this.riskDetails.Content = null;
                    this.riskPenalty.Content = null;
                }
            }
            else
            {
                this.riskDetails.Content = null;
                this.riskPenalty.Content = null;
            }
        }

        /// <summary>
        /// 下达隐患整改通知
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnHandleButtonClick(object sender, RoutedEventArgs e)
        {
            IList<EIRow> _list = this.Grid.GetCheckedEIRows() == null ? new List<EIRow>() : this.Grid.GetCheckedEIRows();

            EIInfo eiInfo = new EIInfo();
            EIBlock eIBlock = new EIBlock("result");
            EIRow row = new EIRow();
            if (_list.Count > 0)
            {
                string fdStatus = _list[0]["fdStatus"].ToString();
                if (null == fdStatus || !"未处理".Equals(fdStatus))
                {
                    this.OpenEFWindowAlert("该记录已经下达隐患整改通知！", true);
                    return;
                }

                row = BaseTools.GetEIRowByOldEIRow(this.EIDataContext.GetBlock("result").GetColumns(), _list[0]);
            }
            eIBlock.SetRow(0, row);
            eiInfo.AddBlock(eIBlock);

            base.OnUpdateButtonClickPopup("通知下达", eiInfo, "隐患整改通知-下达", "update", "handle", sender, e);
        }

        /// <summary>
        /// 复查意见
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnRecheckButtonClick(object sender, RoutedEventArgs e)
        {
            IList<EIRow> _list = this.Grid.GetCheckedEIRows() == null ? new List<EIRow>() : this.Grid.GetCheckedEIRows();

            EIInfo eiInfo = new EIInfo();
            EIBlock eIBlock = new EIBlock("result");
            EIRow row = new EIRow();
            if (_list.Count > 0)
            {
                string fdStatus = _list[0]["fdStatus"].ToString();
                if (null == fdStatus || !"未复查".Equals(fdStatus))
                {
                    this.OpenEFWindowAlert("该记录还未整改完毕，不能进行复查！", true);
                    return;
                }

                row = BaseTools.GetEIRowByOldEIRow(this.EIDataContext.GetBlock("result").GetColumns(), _list[0]);
            }
            eIBlock.SetRow(0, row);
            eiInfo.AddBlock(eIBlock);

            base.OnUpdateButtonClickPopup("复查意见填写", eiInfo, "复查意见-填写", "insert", "recheck", sender, e);
        }

        /// <summary>
        /// 延期
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnDelayButtonClick(object sender, RoutedEventArgs e)
        {
            IList<EIRow> _list = this.Grid.GetCheckedEIRows() == null ? new List<EIRow>() : this.Grid.GetCheckedEIRows();

            EIInfo eiInfo = new EIInfo();
            EIBlock eIBlock = new EIBlock("result");
            EIRow row = new EIRow();
            if (_list.Count > 0)
            {
                string fdStatus = _list[0]["fdStatus"].ToString();
                if (null == fdStatus)
                {
                    return;
                }
                else if ("未处理".Equals(fdStatus))
                {
                    this.OpenEFWindowAlert("该记录还未处理，请先下达整改通知！", true);
                    return;
                }
                else if ("未复查".Equals(fdStatus))
                {
                    this.OpenEFWindowAlert("该记录已经整改完毕，不需要延期调整！", true);
                    return;
                }
                else
                {
                    row = BaseTools.GetEIRowByOldEIRow(this.EIDataContext.GetBlock("result").GetColumns(), _list[0]);
                }
            }
            eIBlock.SetRow(0, row);
            eiInfo.AddBlock(eIBlock);

            base.OnUpdateButtonClickPopup("隐患解决期限延期", eiInfo, "整改延期-修改", "update", "delay", sender, e);
        }

        /// <summary>
        /// 点击罚款 操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnPenaltyButtonClick(object sender, RoutedEventArgs e)
        {
            IList<EIRow> _list = this.Grid.GetCheckedEIRows() == null ? new List<EIRow>() : this.Grid.GetCheckedEIRows();

            EIInfo eiInfo = new EIInfo();
            EIBlock eIBlock = new EIBlock("result");
            EIRow row = new EIRow();
            if (_list.Count > 0)
            {
                row = BaseTools.GetEIRowByOldEIRow(this.EIDataContext.GetBlock("result").GetColumns(), _list[0]);
                string fdStatus = row["fdStatus"] == null ? "" : row["fdStatus"].ToString();
                string fdIsRepeat = row["fdIsRepeat"] == null ? "" : row["fdIsRepeat"].ToString();

                if (null == fdStatus || "未处理".Equals(fdStatus))
                {
                    this.OpenEFWindowAlert("该纪录还未处理，请在处理时进行罚款！", true);
                    return;
                }
            }
            eIBlock.SetRow(0, row);
            eiInfo.AddBlock(eIBlock);

            base.OnUpdateButtonClickPopup("罚款", eiInfo, "罚款记录-新增", "insert", "penalty", sender, e);
        }

        /// <summary>
        /// 点击新增 操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnInsertButtonClick(object sender, RoutedEventArgs e)
        {
            EIInfo eiInfo = new EIInfo();
            base.OnInsertButtonClickPopup(eiInfo, "隐患记录-新增", "insert", null, sender, e);
        }

        /// <summary>
        /// 点击修改 操作
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnUpdateButtonClick(object sender, RoutedEventArgs e)
        {
            IList<EIRow> _list = this.Grid.GetCheckedEIRows() == null ? new List<EIRow>() : this.Grid.GetCheckedEIRows();

            EIInfo eiInfo = new EIInfo();
            EIBlock eIBlock = new EIBlock("result");
            EIRow row = new EIRow();
            if (_list.Count > 0)
            {
                row = BaseTools.GetEIRowByOldEIRow(this.EIDataContext.GetBlock("result").GetColumns(), _list[0]);
                string fdStatus = row["fdStatus"] == null ? "" : row["fdStatus"].ToString();
                string fdIsRepeat = row["fdIsRepeat"] == null ? "" : row["fdIsRepeat"].ToString();

                if (!"未处理".Equals(fdStatus))
                {
                    this.OpenEFWindowAlert("只能修改未处理的隐患记录！", true);
                    return;
                }
                if (null == fdIsRepeat || !"否".Equals(fdIsRepeat))
                {
                    this.OpenEFWindowAlert("重复隐患不能修改，请直接下达隐患通知！", true);
                    return;
                }
            }
            eIBlock.SetRow(0, row);
            eiInfo.AddBlock(eIBlock);

            base.OnUpdateButtonClickPopup(eiInfo, "隐患记录-修改", "update", null, sender, e);
        }

        /// <summary>
        /// 主表新增或处理之前的数据传输
        /// 构造新增页面内容、弹出页面
        /// </summary>
        /// <param name="_eIInfo"></param>
        /// <param name="_title"></param>
        /// <param name="_dialogType"></param>
        public override void OpenPopup(EIInfo _eIInfo, string _title, string _dialogType, string _args)
        {
            if (null != _args && "handle".Equals(_args))
            {
                //弹出隐患处理（下达隐患通知）
                this.OpenHandleWindow(_eIInfo, _title, _dialogType, _args);
            }
            else if ("recheck".Equals(_args))
            {
                //弹出隐患复查（填写复查意见）
                this.OpenRecheckWindow(_eIInfo, _title, _dialogType, _args);
            }
            else if ("delay".Equals(_args))
            {
                //弹出隐患复查（填写复查意见）
                this.OpenDelayWindow(_eIInfo, _title, _dialogType, _args);
            }
            else if ("penalty".Equals(_args))
            {
                //弹出隐患复查（填写复查意见）
                this.OpenPenaltyWindow(_eIInfo, _title, _dialogType, _args);
            }
            else
            {
                //弹出新增、修改隐患整改通知窗口
                this.OpenPopupWindow(_eIInfo, _title, _dialogType, _args);
            }
        }

        /// <summary>
        /// 隐患记录新增
        /// </summary>
        /// <param name="_eIInfo"></param>
        /// <param name="_title"></param>
        /// <param name="_dialogType"></param>
        /// <param name="_args"></param>
        private void OpenPopupWindow(EIInfo _eIInfo, string _title, string _dialogType, string _args)
        {
            RiskRecordInsert _insert = new RiskRecordInsert(_dialogType);
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskSource"));//隐患来源
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskLevel"));//隐患级别
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskClassify"));//隐患分类
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskWorknum"));//隐患班次

            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.orgName"));//组织机构
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.workface"));//工作面
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.path"));//巷道
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.workNote"));//巡检工单
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.examine"));//五个到位分类
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.quality"));//质量标准化分类

            if ("update".Equals(_dialogType))
            {
                _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.empName"));//检查人
            }

            _insert.EIDataContext = new Platform.Core.UI.EIDataContext();
            _insert.EIDataContext.Update(_eIInfo);

            _insert.fdManageDepartmentId.Value = this.EIDataContext.GetAttribute("fdManageDepartmentId");//默认登陆人部门ID
            _insert.fdManageDepartment.Value = this.EIDataContext.GetAttribute("fdManageDepartment");//默认登陆人部门

            CmesWindows _popup = new CmesWindows();//构造一个弹出页面
            _popup.ResizeMode = ResizeMode.NoResize;//设置不能修改窗口大小
            _popup.Header = _title == null ? "" : _title;//设置Title
            _popup.Content = _insert;//让新增页面在弹出窗口显示
            _popup.Closed += new EventHandler<WindowClosedEventArgs>(OpenWindow_Closed);
            _popup.ShowDialog();//模态显示弹出窗口
        }

        /// <summary>
        /// 隐患记录处理（下达隐患整改通知）
        /// </summary>
        /// <param name="_eIInfo"></param>
        /// <param name="_title"></param>
        /// <param name="_dialogType"></param>
        /// <param name="_args"></param>
        private void OpenHandleWindow(EIInfo _eIInfo, string _title, string _dialogType, string _args)
        {
            RiskRecordHandle _handle = new RiskRecordHandle(_dialogType);
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskSource"));//隐患来源
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskLevel"));//隐患级别
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskClassify"));//隐患分类
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskWorknum"));//隐患班次

            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.orgName"));//组织机构
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.workface"));//工作面
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.path"));//巷道
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.workNote"));//巡检工单
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.examine"));//五个到位分类
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.quality"));//质量标准化分类

            _handle.EIDataContext = new Platform.Core.UI.EIDataContext();
            _handle.EIDataContext.Update(_eIInfo);

            CmesWindows _popup = new CmesWindows();//构造一个弹出页面
            _popup.ResizeMode = ResizeMode.NoResize;//设置不能修改窗口大小
            _popup.Header = _title == null ? "" : _title;//设置Title
            _popup.Content = _handle;//让新增页面在弹出窗口显示
            _popup.Closed += new EventHandler<WindowClosedEventArgs>(OpenWindow_Closed);
            _popup.ShowDialog();//模态显示弹出窗口
        }

        /// <summary>
        /// 隐患记录复查（填写复查意见）
        /// </summary>
        /// <param name="_eIInfo"></param>
        /// <param name="_title"></param>
        /// <param name="_dialogType"></param>
        /// <param name="_args"></param>
        private void OpenRecheckWindow(EIInfo _eIInfo, string _title, string _dialogType, string _args)
        {
            RiskRecheck _recheck = new RiskRecheck(_dialogType);
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.empName"));//复查人
            _eIInfo.AddBlock(_block.GetIsRedoBlock(false));//是否重新整改

            _recheck.EIDataContext = new Platform.Core.UI.EIDataContext();
            _recheck.EIDataContext.Update(_eIInfo);

            _recheck.fdRecheckPeopleId.Value = this.EIDataContext.GetAttribute("fdRecheckPeopleId");//复查人ID
           // _recheck.fdRecheckPeople.Value = this.EIDataContext.GetAttribute("fdRecheckPeople");//复查人

            CmesWindows _popup = new CmesWindows();//构造一个弹出页面
            _popup.ResizeMode = ResizeMode.NoResize;//设置不能修改窗口大小
            _popup.Header = _title == null ? "" : _title;//设置Title
            _popup.Content = _recheck;//让新增页面在弹出窗口显示
            _popup.Closed += new EventHandler<WindowClosedEventArgs>(OpenWindow_Closed);
            _popup.ShowDialog();//模态显示弹出窗口
        }

        /// <summary>
        /// 隐患记录延期（延期）
        /// </summary>
        /// <param name="_eIInfo"></param>
        /// <param name="_title"></param>
        /// <param name="_dialogType"></param>
        /// <param name="_args"></param>
        private void OpenDelayWindow(EIInfo _eIInfo, string _title, string _dialogType, string _args)
        {
            RiskDelay _delay = new RiskDelay(_dialogType);
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskSource"));//隐患来源
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskLevel"));//隐患级别
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskClassify"));//隐患分类
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.riskWorknum"));//隐患班次

            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.orgName"));//组织机构
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.workface"));//工作面
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.path"));//巷道
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.workNote"));//巡检工单
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.examine"));//五个到位分类
            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.quality"));//质量标准化分类

            _delay.EIDataContext = new Platform.Core.UI.EIDataContext();
            _delay.EIDataContext.Update(_eIInfo);

            CmesWindows _popup = new CmesWindows();//构造一个弹出页面
            _popup.ResizeMode = ResizeMode.NoResize;//设置不能修改窗口大小
            _popup.Header = _title == null ? "" : _title;//设置Title
            _popup.Content = _delay;//让新增页面在弹出窗口显示
            _popup.Closed += new EventHandler<WindowClosedEventArgs>(OpenWindow_Closed);
            _popup.ShowDialog();//模态显示弹出窗口
        }

        /// <summary>
        /// 隐患记录延期（延期）
        /// </summary>
        /// <param name="_eIInfo"></param>
        /// <param name="_title"></param>
        /// <param name="_dialogType"></param>
        /// <param name="_args"></param>
        private void OpenPenaltyWindow(EIInfo _eIInfo, string _title, string _dialogType, string _args)
        {
            RiskPenalty _penalty = new RiskPenalty(_dialogType);

            _eIInfo.AddBlock(this.EIDataContext.GetBlock("cmes.cl.penaltyType"));//罚款分类

            _penalty.EIDataContext = new Platform.Core.UI.EIDataContext();
            _penalty.EIDataContext.Update(_eIInfo);

            EIRow eIRow = _eIInfo.GetBlock("result").GetRow(0);

            _penalty.fdSendnoteDate.Value = DateTime.Now.ToString("yyyy-MM-dd");
            _penalty.fdRiskRecordId.Value = eIRow["fdKeyId"];//隐患ID
            _penalty.fdSendnoteDepartment.Value = eIRow["fdManageDepartment"];//安全主管部门
            _penalty.fdDepartmentId.Value = eIRow["fdDepartmentId"];//责任部门ID
            _penalty.fdDepartmentName.Value = eIRow["fdDepartment"];//责任部门

            Collection<EIRow> penaltyType = this.EIDataContext.GetBlock("cmes.cl.penaltyType").GetRows();
            IEnumerable<EIRow> penaltyTypeResult = from c in penaltyType where c["display"].ToString().IndexOf("现金") >= 0 select c;
            if (penaltyTypeResult.Count() > 0)
            {
                _penalty.fdClassify.Value = penaltyTypeResult.First()["value"].ToString();
            }

            CmesWindows _popup = new CmesWindows();//构造一个弹出页面
            _popup.ResizeMode = ResizeMode.NoResize;//设置不能修改窗口大小
            _popup.Header = _title == null ? "" : _title;//设置Title
            _popup.Content = _penalty;//让新增页面在弹出窗口显示
            _popup.Closed += new EventHandler<WindowClosedEventArgs>(OpenWindow_Closed);
            _popup.ShowDialog();//模态显示弹出窗口
        }

        /// <summary>
        /// 新增窗口关闭时执行的方法
        /// 新增隐患 罚款单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OpenWindow_Closed(object sender, WindowClosedEventArgs e)
        {
            //按钮生效
            base.TempButtonOpen(true);

            if (e.DialogResult == true)
            {
                //刷新Grid区域
                this.Grid.Refresh();
            }
        }

        /// <summary>
        /// 点击作废按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnInvalidButtonClick(object sender, RoutedEventArgs e)
        {
            base.OnModifyButtonClick("invalid", "作废", sender, e);
        }

        /// <summary>
        /// 点击关闭按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnCloseButtonClick(object sender, RoutedEventArgs e)
        {
            base.OnModifyButtonClick("close", "关闭", sender, e);
        }

        /// <summary>
        /// “打印表单”按钮执行事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void OnPrintButtonClick(object sender, RoutedEventArgs e)
        {
            IList<EIRow> _list = this.Grid.GetCheckedEIRows() == null ? new List<EIRow>() : this.Grid.GetCheckedEIRows();
            StringBuilder fdKeyId = new StringBuilder();

            if (_list.Count == 0)
            {
                DialogParameters param = new DialogParameters();
                param.CancelButtonContent = "取消";
                param.OkButtonContent = "确定";
                param.Content = "请选择要打印的记录！";
                param.Header = "提示框";
                EFWindow.Alert(param);
                return;
            }
            else
            {
                for (int i = 0; i < _list.Count; i++)
                {
                    string fdStatus = _list[i]["fdStatus"] == null ? "" : _list[i]["fdStatus"].ToString();
                    if (!"未复查".Equals(fdStatus))
                    {
                        DialogParameters param = new DialogParameters();
                        param.CancelButtonContent = "取消";
                        param.OkButtonContent = "确定";
                        param.Content = "只能选择状态为未复查的纪录！";
                        param.Header = "提示框";
                        EFWindow.Alert(param);
                        return;
                    }
                    if (i == _list.Count - 1)
                    {
                        fdKeyId.Append("'" + _list[i]["fdKeyId"].ToString() + "'");
                        break;
                    }
                    fdKeyId.Append("'" + _list[i]["fdKeyId"].ToString() + "',"); ;
                }
                Uri uri = Uploader.ConstructAbsoluteUri("../admin/RunmaxReport.jsp?projectName=CMESReport&reportName=recheckReport&fdKeyId=" + fdKeyId.ToString());
                HtmlPage.Window.Navigate(uri, "_blank");
            }
        }
    }
}
